package com.supermali.behavior.up.land;

import com.supermali.behavior.up.UpBehavior;
import com.supermali.entity.MapImageAbstract;

public class UpMiss extends UpBehavior {

    double v;

    long totalTime;

    MapImageAbstract mapImageAbstract;

    public UpMiss(MapImageAbstract mapImageAbstract) {
        v = 150d/1000;
        totalTime=0;
        this.mapImageAbstract = mapImageAbstract;
    }

    @Override
    public void up(long delta) {
        totalTime+=delta;
        double ds = delta*v;
        double v = mapImageAbstract.getY() + ds;
        mapImageAbstract.setY(v);
        if(totalTime>200){
            setStatus(0);
            mapImageAbstract.getMapCreater().getRemoves().add(mapImageAbstract);
        }
    }

}
